<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <section id="gap"></section>
            <section>
                <div class="container">
                    <div class="row">

                        <h:form id="formjogo">
                            <p:messages autoUpdate="true" />
                            <h1>Jogo</h1>
                                <p:panel  styleClass="col-md-12">
                                    <p:outputLabel value="#{languagem['jogo.loteria']}" styleClass="col-md-2"/>
                                    <p:autoComplete id="autocompleteloteria" required="true" 
                                                    value="#{managerJogo.loteria}" completeMethod="#{managerLoteria.autocomplete}" var="lot"
                                                    itemLabel="#{lot.nome}" itemValue="#{lot}" converter="conversorloteria"
                                                    styleClass="col-md-10" dropdown="true"/>
                                    
                                    <p:outputLabel value="#{languagem['jogo.dataJogo']}" styleClass="col-md-2" />
                                    <p:calendar id="datajogo" styleClass="col-md-3" title="#{languagem['jogo.dataJogo']}" 
                                                showOn="button" pattern="dd/MM/yyyy"
                                                value="#{managerJogo.jogo.dataJogo}"/>

                                    <p:outputLabel value="#{languagem['jogo.dataExpiracao']}" styleClass="col-md-3" />
                                    <p:calendar id="dataexpiracao" styleClass="col-md-4" title="#{languagem['jogo.dataExpiracao']}" 
                                                showOn="button"  pattern="dd/MM/yyyy HH:mm"
                                                value="#{managerJogo.jogo.dataExpiracao}"/>

                                    <p:outputLabel value="#{languagem['jogo.valorJackpot']}" styleClass="col-md-2"/>
                                    <p:inputText id="valorjackpot" value="#{managerJogo.jogo.valorJackpot}" 
                                                 styleClass="col-md-3"/>
                                    
                                    <p:outputLabel value="#{languagem['jogo.jackpotsimbolo']}" styleClass="col-md-3"/>
                                    <p:inputText id="currencyjackpot" value="#{managerJogo.jogo.jackpotCurrency}" 
                                                 styleClass="col-md-3"/>
                                    
                                    <p:outputLabel value="#{languagem['jogo.jackpotnumber']}" styleClass="col-md-2"/>
                                    <p:inputText id="numberjackpot" value="#{managerJogo.jogo.jackpotNumber}" 
                                                 styleClass="col-md-3"/>
                                    
                                    <p:outputLabel value="#{languagem['jogo.jackpottext']}" styleClass="col-md-3"/>
                                    <p:inputText id="jackpottext" value="#{managerJogo.jogo.jackpotText}" 
                                                 styleClass="col-md-3"/>
                                    
                                    <div class="buttonAction col-md-12">
                                        <p:commandButton value="#{languagem['salvar']}" styleClass="ui-priority-primary"
                                                         icon="ui-icon-disk"
                                                         actionListener="#{managerJogo.salvar()}" update="@form"
                                                         process="@form"/>
                                        <p:commandButton value="#{languagem['cancelar']}" 
                                                         icon="ui-icon-close" />
                                    </div>

                                </p:panel>
                        </h:form>

                    </div>
                </div>
            </section>
        </ui:define>
    </ui:composition>
</html>
